<!doctype html>



  


<html class="theme-next mist use-motion" lang="zh-Hans">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>



<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />












  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />




  
  
  
  

  
    
    
  

  

  

  

  

  
    
    
    <link href="//fonts.googleapis.com/css?family=Lato:300,300italic,400,400italic,700,700italic&subset=latin,latin-ext" rel="stylesheet" type="text/css">
  






<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=5.1.0" rel="stylesheet" type="text/css" />


  <meta name="keywords" content="jenkins,docker,mesos,dcos,marathon,服务发现,负载均衡,Nginx,HAProxy," />








  <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico?v=5.1.0" />






<meta name="description" content="讨论正题之前，先讲一个场景，有个同事，非技术人员，他想体验一下Phacility公司的 Phabricator 产品，于是从网上搜索各种安装文档，着手安装。搞技术的都知道，现在的服务大多数部署在Linux环境，所以安装文档优先考虑Linux的部署，而技术人员的另一个爱好就是在文档中简单的几句描述一下命令行步骤就不管了，类似Windows上的图形化安装，那是奢求，尤其是对开源产品，所以过程可想而知。">
<meta property="og:type" content="article">
<meta property="og:title" content="遗留应用如何快速迁移到DC/OS">
<meta property="og:url" content="http://chrisrc.me/2016/12/18/legacy-app-on-dcos/index.html">
<meta property="og:site_name" content="山中，山外与俯瞰">
<meta property="og:description" content="讨论正题之前，先讲一个场景，有个同事，非技术人员，他想体验一下Phacility公司的 Phabricator 产品，于是从网上搜索各种安装文档，着手安装。搞技术的都知道，现在的服务大多数部署在Linux环境，所以安装文档优先考虑Linux的部署，而技术人员的另一个爱好就是在文档中简单的几句描述一下命令行步骤就不管了，类似Windows上的图形化安装，那是奢求，尤其是对开源产品，所以过程可想而知。">
<meta property="og:updated_time" content="2016-12-19T09:06:04.000Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="遗留应用如何快速迁移到DC/OS">
<meta name="twitter:description" content="讨论正题之前，先讲一个场景，有个同事，非技术人员，他想体验一下Phacility公司的 Phabricator 产品，于是从网上搜索各种安装文档，着手安装。搞技术的都知道，现在的服务大多数部署在Linux环境，所以安装文档优先考虑Linux的部署，而技术人员的另一个爱好就是在文档中简单的几句描述一下命令行步骤就不管了，类似Windows上的图形化安装，那是奢求，尤其是对开源产品，所以过程可想而知。">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Mist',
    sidebar: {"position":"left","display":"post"},
    fancybox: true,
    motion: true,
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="http://chrisrc.me/2016/12/18/legacy-app-on-dcos/"/>





  <title> 遗留应用如何快速迁移到DC/OS | 山中，山外与俯瞰 </title>
</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  










  
  
    
  

  <div class="container one-collumn sidebar-position-left page-post-detail ">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-meta ">
  

  <div class="custom-logo-site-title">
    <a href="/"  class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <span class="site-title">山中，山外与俯瞰</span>
      <span class="logo-line-after"><i></i></span>
    </a>
  </div>
  <p class="site-subtitle">一次永不停止的探索之旅</p>
</div>

<div class="site-nav-toggle">
  <button>
    <span class="btn-bar"></span>
    <span class="btn-bar"></span>
    <span class="btn-bar"></span>
  </button>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-dcos">
          <a href="/dcos" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-book"></i> <br />
            
            DC/OS
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/categories" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br />
            
            分类
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/about" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-user"></i> <br />
            
            关于
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />
            
            归档
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br />
            
            标签
          </a>
        </li>
      

      
        <li class="menu-item menu-item-search">
          
            <a href="javascript:;" class="st-search-show-outputs">
          
            
              <i class="menu-item-icon fa fa-search fa-fw"></i> <br />
            
            搜索
          </a>
        </li>
      
    </ul>
  

  
    <div class="site-search">
      
  <form class="site-search-form">
  <input type="text" id="st-search-input" class="st-search-input st-default-search-input" />
</form>

<script type="text/javascript">
  (function(w,d,t,u,n,s,e){w['SwiftypeObject']=n;w[n]=w[n]||function(){
    (w[n].q=w[n].q||[]).push(arguments);};s=d.createElement(t);
    e=d.getElementsByTagName(t)[0];s.async=1;s.src=u;e.parentNode.insertBefore(s,e);
  })(window,document,'script','//s.swiftypecdn.com/install/v2/st.js','_st');

  _st('install', 'R9GcmhBwxpsAGLNCsquZ','2.0.0');
</script>



    </div>
  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal " itemscope itemtype="http://schema.org/Article">
  <link itemprop="mainEntityOfPage" href="http://chrisrc.me/2016/12/18/legacy-app-on-dcos/">

  <span style="display:none" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <meta itemprop="name" content="chrisrc">
    <meta itemprop="description" content="">
    <meta itemprop="image" content="/images/avatar.gif">
  </span>

  <span style="display:none" itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
    <meta itemprop="name" content="山中，山外与俯瞰">
    <span style="display:none" itemprop="logo" itemscope itemtype="http://schema.org/ImageObject">
      <img style="display:none;" itemprop="url image" alt="山中，山外与俯瞰" src="">
    </span>
  </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">
            
            
              
                遗留应用如何快速迁移到DC/OS
              
            
          </h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>
              <time title="Post created" itemprop="dateCreated datePublished" datetime="2016-12-18T08:28:18+08:00">
                2016-12-18
              </time>
            

            

            
          </span>

          
            <span class="post-category" >
              <span class="post-meta-divider">|</span>
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/DC-OS/" itemprop="url" rel="index">
                    <span itemprop="name">DC/OS</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
              <span class="post-comments-count">
                <span class="post-meta-divider">|</span>
                <a href="/2016/12/18/legacy-app-on-dcos/#comments" itemprop="discussionUrl">
                  <span class="post-comments-count ds-thread-count" data-thread-key="2016/12/18/legacy-app-on-dcos/" itemprop="commentCount"></span>
                </a>
              </span>
            
          

          

          
          

          

          

        </div>
      </header>
    


    <div class="post-body" itemprop="articleBody">

      
      

      
        <p>讨论正题之前，先讲一个场景，有个同事，非技术人员，他想体验一下Phacility公司的 <strong><a href="https://www.phacility.com/" target="_blank" rel="external">Phabricator</a></strong> 产品，于是从网上搜索各种安装文档，着手安装。搞技术的都知道，现在的服务大多数部署在Linux环境，所以安装文档优先考虑Linux的部署，而技术人员的另一个爱好就是在文档中简单的几句描述一下命令行步骤就不管了，类似Windows上的图形化安装，那是奢求，尤其是对开源产品，所以过程可想而知。</p>
<a id="more"></a>
<p>Phabricator是PHP开发，依赖MySQL数据库，推荐跑在Nginx中。我的这位同事参照文档，搞定了数据库（至少完成了安装），卡在了Nginx上，他用的Macbook，找了几个技术来帮忙，比较诡异，都没搞定，我看了一下，也没找出问题，因为有别的事，也没心思细琢磨。然后，突然想起来，只是个体验，直接用Docker跑个Phabricator的镜像不就OK了，瞬间觉得思维又开阔了些。</p>
<p>最近一直在深入研究DC/OS，这件事让我开始进一步思考遗留应用的迁移问题。下面进入正题：</p>
<h3 id="遗留应用的特点"><a href="#遗留应用的特点" class="headerlink" title="遗留应用的特点"></a>遗留应用的特点</h3><p>遗留应用最明显的一个特点是与运行环境强力绑定，有的应用具有复杂的依赖，超级复杂的配置，一旦部署，没人“敢”调整。</p>
<p>遗留应用的另一个问题是扩展非常复杂。如果没有完整的文档，新增节点服务启动后很可能会发现：用户忘记创建，目录忘记创建，目录权限忘记设置，端口忘记打开，某个依赖的应用忘记安装，目录链接忘记创建，NFS忘记挂载，Nginx代理忘记配置，某个系统参数忘记调整等等。这是运维人员的噩梦。</p>
<p>再讲一个实际案例，我们有个产品采用ansible管理应用的持续部署，但是，有一天，应用要部署到一个新节点，而这个新节点已经部署了部分应用，Ansible部署时设定的环境与现有环境冲突，需要重新调整脚本。这也是一个运维过程中经常出现的场景。面对这种问题，不同的决策可能带来不同的结果，有好有坏。</p>
<p>这一切问题的核心根源是什么？应用服务运行需要满足一定的环境。如果把这个环境制作成光盘，把应用烧录进去，插入光驱即可运行，这种场景多么美好。</p>
<p>一种思路是走<strong>虚拟机镜像</strong>，这是一种可行的方案，但是它太“<strong>重</strong>”了，我一个APP本来只要512MB内存就可以跑，为了启动个虚拟机，还要再多分配512MB甚至更多内存，一台4GB内存的主机能跑几个应用？！</p>
<h3 id="容器带来的优势"><a href="#容器带来的优势" class="headerlink" title="容器带来的优势"></a>容器带来的优势</h3><p>容器带来的好处是什么？</p>
<p>很明显，<strong>第一个好处</strong>是，它可以让你把你的应用的运行环境构建到一个镜像文件中，这样你就再也不用为了让用户能够体验你的产品，而针对各种系统各种版本编写各种安装程序，然后写一本书一样的安装手册，再然后到处培训，不厌其烦的给用户解释各种问题，帮助用户调试各种奇葩的运行环境。</p>
<p><strong>第二个好处</strong>，docker并没有为你的应用构建一个操作系统，它很轻量，还是运行在现有的系统环境中，跟其他应用使用相同的CPU，内存和磁盘，不同的是在操作系统内核级别做了资源隔离。</p>
<p>随之<strong>第三个好处</strong>是，因为隔离，你的系统环境非常“干净”。不必因为要运行某个应用需要安装一堆的依赖，卸载时无法卸载干净，在安装另一个应用时因为依赖的版本冲突不得不绞尽脑汁想各种奇葩的手段，最后还可能无功而返，不得不重装系统。</p>
<p><strong>第四个好处</strong>是容器让应用更具弹性，服务节点可以随时上下线，根据需求快速伸缩。</p>
<p><strong>再有</strong>，它弥合了Dev和ops之间的鸿沟，专业的人做专业的事。开发人员知道自己的应用需要什么环境，如何配置；运维人员知道服务态势，可以根据需要调整资源配给。</p>
<h3 id="遗留应用如何发挥容器的优势"><a href="#遗留应用如何发挥容器的优势" class="headerlink" title="遗留应用如何发挥容器的优势"></a>遗留应用如何发挥容器的优势</h3><p>遗留应用通常处于少量开发甚至不再开发或维护的状态。不必担心，这个问题不会成为迁移到容器的障碍。只需要准备好基础系统，所需依赖，按照应用的部署过程定义一个Dockerfile，生成一个镜像文件，就可以解放了。应用还是那个应用，它不再依赖陈旧的设备，难以维护的环境可以随时随地迁移重组。</p>
<p>解决了遗留应用对环境的依赖问题，就可以将应用部署到弹性计算环境中，根据需要动态地调配资源，而这正是DCOS/Mesos集群的工作目标。</p>
<h3 id="在DC-OS中部署遗留应用"><a href="#在DC-OS中部署遗留应用" class="headerlink" title="在DC/OS中部署遗留应用"></a>在DC/OS中部署遗留应用</h3><p>DC/OS即数据中心操作系统是Apache Mesos, Marathon, Docker容器及其它很多服务（监控、日志、负载均衡及服务发现等）整合而成的服务调度管理平台。DC/OS提供了一个完整的弹性计算环境，让部署的应用服务可以开箱即用</p>
<p>当前DC/OS支持AppC容器和Docker容器两种应用定义。可以根据应用的具体类型和特点，选择特定的方案。</p>
<h4 id="直接部署"><a href="#直接部署" class="headerlink" title="直接部署"></a>直接部署</h4><p>以部署一个Tomcat应用为例，可以直接通过Marathon下载Tomcat发布程序，打包好的应用War包，然后启动Tomcat。这个过程可以通过Marathon的应用JSON定义描述：</p>
<figure class="highlight json"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div></pre></td><td class="code"><pre><div class="line">&#123;</div><div class="line">    <span class="attr">"id"</span>: <span class="string">"tomcat"</span>,</div><div class="line">    <span class="attr">"cmd"</span>: <span class="string">"mv *.war apache-tomcat-*/webapps &amp;&amp; cd apache-tomcat-* &amp;&amp; sed \"s/8080/$PORT/g\" &lt; ./conf/server.xml &gt; ./conf/server-mesos.xml &amp;&amp; ./bin/catalina.sh run -config ./conf/server-mesos.xml"</span>,</div><div class="line">    <span class="attr">"mem"</span>: <span class="number">512</span>,</div><div class="line">    <span class="attr">"cpus"</span>: <span class="number">1.0</span>,</div><div class="line">    <span class="attr">"disk"</span>: <span class="number">4096</span>,</div><div class="line">    <span class="attr">"instances"</span>: <span class="number">1</span>,</div><div class="line">    <span class="attr">"uris"</span>: [</div><div class="line">        <span class="string">"http://mirrors.aliyun.com/apache/tomcat/tomcat-8/v8.5.6/bin/apache-tomcat-8.5.6.tar.gz"</span>,</div><div class="line">        <span class="string">"http://192.168.1.100/nexus/content/repositories/releases/com/example/example/1.0/example-1.0.war"</span></div><div class="line">    ]</div><div class="line">&#125;</div></pre></td></tr></table></figure>
<p>这个Tomcat应用部署到DC/OS集群后，就可以根据需要动态调整应用的服务实例数，可以通过Marathon-LB为这个应用服务提供负载均衡。</p>
<h4 id="Docker容器部署"><a href="#Docker容器部署" class="headerlink" title="Docker容器部署"></a>Docker容器部署</h4><p>如果上述Tomcat+应用War包封装为一个名为“docker-tomcat-war”的Docker镜像，则可以以Docker容器化的方式直接在DC/OS集群中运行该应用。<br>同样需要定义一个Marathon应用JSON描述文件：</p>
<figure class="highlight json"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div></pre></td><td class="code"><pre><div class="line">&#123;</div><div class="line">    <span class="attr">"id"</span>: <span class="string">"exampleapp"</span>,</div><div class="line">    <span class="attr">"instances"</span>: <span class="number">1</span>,</div><div class="line">    <span class="attr">"cpus"</span>: <span class="number">0.25</span>,</div><div class="line">    <span class="attr">"mem"</span>: <span class="number">128</span>,</div><div class="line">    <span class="attr">"uris"</span>:[],</div><div class="line">    <span class="attr">"env"</span>: &#123; &#125;,</div><div class="line">    <span class="attr">"ports"</span>:[<span class="number">9000</span>],</div><div class="line">    <span class="attr">"container"</span>: &#123;</div><div class="line">        <span class="attr">"type"</span>: <span class="string">"DOCKER"</span>,</div><div class="line">        <span class="attr">"volumes"</span>: [],</div><div class="line">        <span class="attr">"docker"</span>: &#123;</div><div class="line">            <span class="attr">"image"</span>: <span class="string">"chrisrc/docker-tomcat-war:0.0.1"</span>,</div><div class="line">            <span class="attr">"network"</span>: <span class="string">"BRIDGE"</span>,</div><div class="line">            <span class="attr">"portMappings"</span>: [&#123; <span class="attr">"containerPort"</span>: <span class="number">8080</span>, <span class="attr">"servicePort"</span>: <span class="number">9000</span> , <span class="attr">"hostPort"</span>: <span class="number">0</span>, <span class="attr">"protocol"</span>: <span class="string">"tcp"</span> &#125;]</div><div class="line">        &#125;</div><div class="line">    &#125;</div><div class="line">&#125;</div></pre></td></tr></table></figure>
<h3 id="结论"><a href="#结论" class="headerlink" title="结论"></a>结论</h3><p>关于上述示例的详细步骤可以参考“<a href="http://chrisrc.me/dcos/dcos-service-jenkins-example.html">在Jenkins on DCOS上编译部署Tomcat应用</a>”</p>
<p>通过简单的Marathon应用程序定义，应用既可以迁移运行在弹性计算的环境，又可以直接使用DC/OS平台所提供的各种监控、调度和负载均衡方案，让应用的维护不再一片“黑暗”。</p>

      
    </div>

    <div>
      
        

      
    </div>

    <div>
      
        

      
    </div>


    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/jenkins/" rel="tag"># jenkins</a>
          
            <a href="/tags/docker/" rel="tag"># docker</a>
          
            <a href="/tags/mesos/" rel="tag"># mesos</a>
          
            <a href="/tags/dcos/" rel="tag"># dcos</a>
          
            <a href="/tags/marathon/" rel="tag"># marathon</a>
          
            <a href="/tags/服务发现/" rel="tag"># 服务发现</a>
          
            <a href="/tags/负载均衡/" rel="tag"># 负载均衡</a>
          
            <a href="/tags/Nginx/" rel="tag"># Nginx</a>
          
            <a href="/tags/HAProxy/" rel="tag"># HAProxy</a>
          
        </div>
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2016/12/17/cluster-dev-on-dcos-1/" rel="next" title="如何快速构建大规模应用集群（开篇）">
                <i class="fa fa-chevron-left"></i> 如何快速构建大规模应用集群（开篇）
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2017/01/18/gitbook-publish-on-dcos/" rel="prev" title="在DC/OS集群中自动发布Gitbook">
                在DC/OS集群中自动发布Gitbook <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </article>



    <div class="post-spread">
      
        <div class="ds-share flat" data-thread-key="2016/12/18/legacy-app-on-dcos/"
     data-title="遗留应用如何快速迁移到DC/OS"
     data-content=""
     data-url="http://chrisrc.me/2016/12/18/legacy-app-on-dcos/">
  <div class="ds-share-inline">
    <ul  class="ds-share-icons-16">

      <li data-toggle="ds-share-icons-more"><a class="ds-more" href="javascript:void(0);">分享到：</a></li>
      <li><a class="ds-weibo" href="javascript:void(0);" data-service="weibo">微博</a></li>
      <li><a class="ds-qzone" href="javascript:void(0);" data-service="qzone">QQ空间</a></li>
      <li><a class="ds-qqt" href="javascript:void(0);" data-service="qqt">腾讯微博</a></li>
      <li><a class="ds-wechat" href="javascript:void(0);" data-service="wechat">微信</a></li>

    </ul>
    <div class="ds-share-icons-more">
    </div>
  </div>
</div>
      
    </div>
  </div>


          </div>
          


          
  <div class="comments" id="comments">
    
      <div class="ds-thread" data-thread-key="2016/12/18/legacy-app-on-dcos/"
           data-title="遗留应用如何快速迁移到DC/OS" data-url="http://chrisrc.me/2016/12/18/legacy-app-on-dcos/">
      </div>
    
  </div>


        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap" >
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
          <img class="site-author-image" itemprop="image"
               src="/images/avatar.gif"
               alt="chrisrc" />
          <p class="site-author-name" itemprop="name">chrisrc</p>
          <p class="site-description motion-element" itemprop="description"></p>
        </div>
        <nav class="site-state motion-element">
          <div class="site-state-item site-state-posts">
            <a href="/archives">
              <span class="site-state-item-count">69</span>
              <span class="site-state-item-name">日志</span>
            </a>
          </div>

          
            <div class="site-state-item site-state-categories">
              <a href="/categories">
                <span class="site-state-item-count">21</span>
                <span class="site-state-item-name">分类</span>
              </a>
            </div>
          

          
            <div class="site-state-item site-state-tags">
              <a href="/tags">
                <span class="site-state-item-count">162</span>
                <span class="site-state-item-name">标签</span>
              </a>
            </div>
          

        </nav>

        

        <div class="links-of-author motion-element">
          
            
              <span class="links-of-author-item">
                <a href="https://github.com/christtrc" target="_blank" title="GitHub">
                  
                    <i class="fa fa-fw fa-github"></i>
                  
                  GitHub
                </a>
              </span>
            
              <span class="links-of-author-item">
                <a href="https://twitter.com/chrisrc" target="_blank" title="Twitter">
                  
                    <i class="fa fa-fw fa-twitter"></i>
                  
                  Twitter
                </a>
              </span>
            
          
        </div>

        
        
          <div class="cc-license motion-element" itemprop="license">
            <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" class="cc-opacity" target="_blank">
              <img src="/images/cc-by-nc-sa.svg" alt="Creative Commons" />
            </a>
          </div>
        

        
        

        


      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-3"><a class="nav-link" href="#遗留应用的特点"><span class="nav-number">1.</span> <span class="nav-text">遗留应用的特点</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#容器带来的优势"><span class="nav-number">2.</span> <span class="nav-text">容器带来的优势</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#遗留应用如何发挥容器的优势"><span class="nav-number">3.</span> <span class="nav-text">遗留应用如何发挥容器的优势</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#在DC-OS中部署遗留应用"><span class="nav-number">4.</span> <span class="nav-text">在DC/OS中部署遗留应用</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#直接部署"><span class="nav-number">4.1.</span> <span class="nav-text">直接部署</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#Docker容器部署"><span class="nav-number">4.2.</span> <span class="nav-text">Docker容器部署</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#结论"><span class="nav-number">5.</span> <span class="nav-text">结论</span></a></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright" >
  
  &copy;  2015 - 
  <span itemprop="copyrightYear">2017</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">
     
      <a href="mailto:chrisrc@qq.com">chrisrc</a> 
    
  </span>
  <span class="author"> &nbsp; QQ: 58122705 </span>
</div>


<div class="powered-by">
  由 <a class="theme-link" href="https://hexo.io">Hexo</a> 强力驱动
</div>

<div class="theme-info">
  主题 -
  <a class="theme-link" href="https://github.com/iissnan/hexo-theme-next">
    NexT.Mist
  </a>
</div>


        

        
      </div>
    </footer>

    <div class="back-to-top">
      <i class="fa fa-arrow-up"></i>
    </div>
  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  



  
  <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>

  
  <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>

  
  <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.0"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.0"></script>



  
  

  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.0"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.0"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.0"></script>



  

  
    
  

  <script type="text/javascript">
    var duoshuoQuery = {short_name:"chrisrc"};
    (function() {
      var ds = document.createElement('script');
      ds.type = 'text/javascript';ds.async = true;
      ds.id = 'duoshuo-script';
      ds.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//static.duoshuo.com/embed.js';
      ds.charset = 'UTF-8';
      (document.getElementsByTagName('head')[0]
      || document.getElementsByTagName('body')[0]).appendChild(ds);
    })();
  </script>

  
    
    
    <script src="/lib/ua-parser-js/dist/ua-parser.min.js?v=0.7.9"></script>
    <script src="/js/src/hook-duoshuo.js"></script>
  








  
  

  

  

  
<script>
(function(){
    var bp = document.createElement('script');
    var curProtocol = window.location.protocol.split(':')[0];
    if (curProtocol === 'https') {
        bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';        
    }
    else {
        bp.src = 'http://push.zhanzhang.baidu.com/push.js';
    }
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(bp, s);
})();
</script>


  
<script>
(function(){
   var src = (document.location.protocol == "http:") ? "http://js.passport.qihucdn.com/11.0.1.js?ed903ab05fbc5fa64d95e4bfbf3d3a04":"https://jspassport.ssl.qhimg.com/11.0.1.js?ed903ab05fbc5fa64d95e4bfbf3d3a04";
   document.write('<script src="' + src + '" id="sozz"><\/script>');
})();
</script>

  


</body>
</html>
